﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mapeo;
using NHibernate;
using MySql.Data.MySqlClient;
using System.Data;

namespace BL
{
    public class ReporteInformeOrdenMerito_BL : Controlador
    {



        public DataTable obtenerDataReporte(String CodigoEspecialidad, String Ciclo, String CodigoSemestre)
        {
            using (ISession Sesion = m_SessionFactory.OpenSession())
            {
                using (ITransaction Trans = Sesion.BeginTransaction())
                {
                    MySqlCommand SqlCmd = new MySqlCommand();
                    SqlCmd.Connection = (MySqlConnection)Sesion.Connection;
                    Trans.Enlist(SqlCmd);
                    SqlCmd.CommandText = "sp_DATA_PROMEDIOS_ListaPonderados";
                    SqlCmd.CommandType = System.Data.CommandType.StoredProcedure;
                    SqlCmd.Parameters.AddWithValue("@in_Idespecialidad", CodigoEspecialidad);
                    SqlCmd.Parameters.AddWithValue("@in_Idciclo", Ciclo);
                    SqlCmd.Parameters.AddWithValue("@in_semestre", CodigoSemestre);
                    SqlCmd.ExecuteNonQuery();

                    MySqlDataAdapter da = new MySqlDataAdapter(SqlCmd);
                    DataTable dt = new DataTable();
                    da.Fill(dt);
                    Trans.Commit();
                    return dt;
                }
            }
        }


    }
}
